package com.wingsfrog.travel.modules.entity;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by rankin on 16/3/30.
 */
@Entity
@Table(name = "t_team_info", schema = "", catalog = "travel")
public class TeamInfo {
    private int id;
    private String teamName;
    private int existMemberNum;
    private int maxMember;
    private Timestamp createdAt;
    private Timestamp updatedAt;
    private String createBy;
    private String updateBy;
    private Integer mainTaskId;

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy=GenerationType.TABLE)
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Column(name="main_task_id")
    public Integer getMainTaskId() {
        return mainTaskId;
    }

    public void setMainTaskId(Integer mainTaskId) {
        this.mainTaskId = mainTaskId;
    }

    @Basic
    @Column(name = "team_name")
    public String getTeamName() {
        return teamName;
    }

    public void setTeamName(String teamName) {
        this.teamName = teamName;
    }

    @Basic
    @Column(name = "exist_member_num")
    public int getExistMemberNum() {
        return existMemberNum;
    }

    public void setExistMemberNum(int existMemberNum) {
        this.existMemberNum = existMemberNum;
    }

    @Basic
    @Column(name = "max_member")
    public int getMaxMember() {
        return maxMember;
    }

    public void setMaxMember(int maxMember) {
        this.maxMember = maxMember;
    }

    @Basic
    @Column(name = "created_at")
    public Timestamp getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(Timestamp createdAt) {
        this.createdAt = createdAt;
    }

    @Basic
    @Column(name = "updated_at")
    public Timestamp getUpdatedAt() {
        return updatedAt;
    }

    public void setUpdatedAt(Timestamp updatedAt) {
        this.updatedAt = updatedAt;
    }

    @Basic
    @Column(name = "create_by")
    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    @Basic
    @Column(name = "update_by")
    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        TeamInfo teamInfo = (TeamInfo) o;

        if (id != teamInfo.id) return false;
        if (existMemberNum != teamInfo.existMemberNum) return false;
        if (maxMember != teamInfo.maxMember) return false;
        if (teamName != null ? !teamName.equals(teamInfo.teamName) : teamInfo.teamName != null) return false;
        if (createdAt != null ? !createdAt.equals(teamInfo.createdAt) : teamInfo.createdAt != null) return false;
        if (updatedAt != null ? !updatedAt.equals(teamInfo.updatedAt) : teamInfo.updatedAt != null) return false;
        if (createBy != null ? !createBy.equals(teamInfo.createBy) : teamInfo.createBy != null) return false;
        if (updateBy != null ? !updateBy.equals(teamInfo.updateBy) : teamInfo.updateBy != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id;
        result = 31 * result + (teamName != null ? teamName.hashCode() : 0);
        result = 31 * result + existMemberNum;
        result = 31 * result + maxMember;
        result = 31 * result + (createdAt != null ? createdAt.hashCode() : 0);
        result = 31 * result + (updatedAt != null ? updatedAt.hashCode() : 0);
        result = 31 * result + (createBy != null ? createBy.hashCode() : 0);
        result = 31 * result + (updateBy != null ? updateBy.hashCode() : 0);
        return result;
    }
}
